﻿Imports System.Globalization
Imports System.Runtime.Serialization

<DataContract()>
Public Class Station
    Implements ICloneable

    Private _Id As String
    ''' <summary>
    ''' 放送局ID
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Id() As String
        Get
            Return _Id
        End Get
        Set(ByVal value As String)
            _Id = value
        End Set
    End Property

    ''' <summary>
    ''' 放送局の種類
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property Kind() As StationKind
        Get
            If Me.Id.StartsWith("ch", StringComparison.Ordinal) Then
                Return StationKind.Channel
            ElseIf Me.Id.StartsWith("co", StringComparison.Ordinal) Then
                Return StationKind.Community
            Else
                Return StationKind.None
            End If
        End Get
    End Property

    Private _Name As String = ""
    ''' <summary>
    ''' 放送局名
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Name() As String
        Get
            Return _Name
        End Get
        Set(ByVal value As String)
            _Name = value
        End Set
    End Property


    Private _IconUri As Uri
    Public Property IconUri() As Uri
        Get
            Return _IconUri
        End Get
        Set(ByVal value As Uri)
            _IconUri = value
        End Set
    End Property


    Private _UpdateDateTime As DateTime
    ''' <summary>
    ''' 放送局ページの更新日時
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property UpdateDateTime() As DateTime
        Get
            Return _UpdateDateTime
        End Get
        Set(ByVal value As DateTime)
            _UpdateDateTime = value
        End Set
    End Property

    Private _Rating As Integer
    ''' <summary>
    ''' ユーザーによる放送局の評価
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Rating() As Integer
        Get
            Return _Rating
        End Get
        Set(ByVal value As Integer)
            _Rating = value
        End Set
    End Property

    Private _IsFavorite As Boolean
    ''' <summary>
    ''' 通知対象かどうか
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property IsFavorite() As Boolean
        Get
            Return _IsFavorite
        End Get
        Set(ByVal value As Boolean)
            _IsFavorite = value
        End Set
    End Property

    Private _Level As Integer
    ''' <summary>
    ''' コミュニティのレベル
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Level() As Integer
        Get
            Return _Level
        End Get
        Set(ByVal value As Integer)
            _Level = value
        End Set
    End Property

    Private _MemberCount As Integer
    ''' <summary>
    ''' 参加メンバー数
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property MemberCount() As Integer
        Get
            Return _MemberCount
        End Get
        Set(ByVal value As Integer)
            _MemberCount = value
        End Set
    End Property

    Private _Note As String = ""
    ''' <summary>
    ''' ユーザーによる放送局のメモ
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property Note() As String
        Get
            Return _Note
        End Get
        Set(ByVal value As String)
            _Note = value
        End Set
    End Property

    Public Property AlertGroupId As Guid

    Public Function Clone() As Object Implements System.ICloneable.Clone
        Return Me.MemberwiseClone
    End Function

End Class
